#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

class Solution {
public:
    int differenceOfSum(vector<int>& nums)
    {
        long long x = 0;
        long long y = 0;
        for (auto& i : nums)
        {
            x += i;
            while (i)
            {
                y += i % 10;
                i /= 10;
            }
        }
        return abs(x - y);
    }
};